package work.tools.deadline
{
	/**
	 * 打开的次数限制 条件类
	 * @author zhangfeng
	 * @see Deadline
	 * @see IQualification
	 */
	public class QualificationOpenTotal implements IQualification
	{
		private var _openTotal:uint;
		/**
		 * 打开的次数限制 条件类 
		 * @param total
		 * 
		 */
		public function QualificationOpenTotal(total:uint=100)
		{
			_openTotal=total;
		}
		
		/**
		 * 打开总次数 
		 * @return 
		 * 
		 */
		public function get openTotal():uint
		{
			return _openTotal;
		}

		public function set openTotal(value:uint):void
		{
			_openTotal = value;
		}

		/**
		 * @inheritDoc 
		 * 
		 */
		public function execute():Number
		{
			var num:uint=QualificationGroups.getInstance().openCount;
			if(num>_openTotal)
			{
				return -10000;
			}
			return 10000;
		}
		
		/**
		 * @inheritDoc 
		 * 
		 */
		public function getClassName():String
		{
			return "QualificationOpenTotal";
		}
	}
}